requested_toppings = ['mushrooms', 'green peppers', 'extra cheese']
for requested_topping in requested_toppings:
    if requested_topping == 'green peppers':
        print("Sorry,we are out of green peppers right now.")
    else:
        print(f"Adding {requested_topping}.")
print("\nFinished making your pizza!")

# 5.4.2
requested_toppings = []
if requested_toppings:
    for requested_topping in requested_toppings:
        print(f"Adding {requested_topping}.")
    print("\nFinshed making your pizza!")
else:
    print("Are you sure you want a plain pizza?")

# 练习
# 5-8
usernames = ['admin', '王靖圆', '吴家文', '周志强', '张少龙', '丛浩然']
for username in usernames:
    if username == 'admin':
        print(f"Hello {username},would you like to see a status report?")
    else:
        print(f"Hello {username},thank you for logging in again.")

# 5-9
usernames = []
if usernames:
    for username in usernames:
        if username == 'admin':
            print(f"Hello {username},would you like to see a status report?")
        else:
            print(f"Hello {username},thank you for logging in again.")
else:
    print("We need to find some users!")

#5-10
current_users = ['John','Sam','jack','rose','Admin','Hophip']
new_users = ['JOHN','Siri','Xiaoai','Admin','Lisa']
current_users1 = []
for current_user in current_users:
    current_users1.append(current_user.lower())
print(current_users1)
for new_user in new_users:
    if new_user.lower() in current_users1:
        print("此用户已存在，请更换其他名称！")
    else:
        print("此用户名可用")

#5-11
numbers = []
for number in range(1,10):
    numbers.append(number)
    if number == 1:
        print('1st\n')
    elif number == 2:
        print('2nd\n')
    elif number == 3:
        print('3rd\n')
    else:
        print(f"{number}th\n")
